const Router = require('koa-router');
const {auth} = require('../middleware/auth.middleware');
const {getBrandList, addBrand, updateBrand, deleteBrand, getBrandDetail} = require('../controller/brandController')
const {brandValidator} = require('../middleware/brand.middleware')

const brandRouter = new Router({prefix: '/brand'});

brandRouter.get('/list', auth, getBrandList);

brandRouter.post('/add', auth, brandValidator, addBrand);

brandRouter.put('/update/:id', auth, brandValidator, updateBrand);

brandRouter.delete('/delete/:id', auth, deleteBrand);

brandRouter.get('/getDetail/:id', auth, getBrandDetail);

module.exports = brandRouter;
